import { aesDecrypt, aesEncrypt } from "@/utils/encrypt.js";

export default defineEventHandler(async (event) => {
    const query = await getQuery(event);

    // 获取query
    const currQuery = aesDecrypt(query.query);
    const code = query.code;

    const params = new URLSearchParams(currQuery);
    if (params.has('code')) {
        params.delete('code');
    }

    sendRedirect(event, "https://mshare.ykjhr.com/?" + aesEncrypt(params.toString() + '&code=' + code), 301);
})